<template>
    <div class="mytreatment">
        <div class="record" style="margin-bottom: 10px;">
            <h4>药品记录</h4>
        </div>
        <p v-for="item in myDrugList" style="margin-bottom: 10px;">
            <el-card style="height: 200px;">
                <p>{{ item.createTime }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ item.petName }}</p>
                <el-table :data="item.drugList">
                    <el-table-column prop="drugName" label="药品名称" width="200">
                    </el-table-column>
                    <el-table-column prop="count" label="数量" width="180">
                    </el-table-column>
                </el-table>
            </el-card>
        </p>


    </div>
</template>

<script>
export default {
    data() {
        return {
            myDrugList:[]
        }
    },
    created() {
        this.getMyDrugList()
    },
    methods: {
        getMyDrugList() {
            //获取我的药物记录列表数据
            var customerId = JSON.parse(localStorage.getItem("customer")).id
            this.request.get("/pet-drug/bycustomer/"+customerId).then(res => {
                this.myDrugList = res.data
                console.log("当前数据====>", this.myDrugList)
            })

        }
    },
}
</script>

<style lang="less" scoped>
.mytreatment {
    padding: 0;

    .record {
        height: 40px;
        border-bottom: 1px solid gray;
    }
}
</style>